package net.system.sys.dao.impl;

import java.util.List;
import net.system.base.bean.SSysdict;
import net.system.base.bean.SSysdictExample;
import net.system.sys.dao.SSysdictDAO;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class SSysdictDAOImpl extends SqlMapClientDaoSupport implements SSysdictDAO {

    public SSysdictDAOImpl() {
        super();
    }

    public void insert(SSysdict record) {
        getSqlMapClientTemplate().insert("s_sysdict.abatorgenerated_insert", record);
    }

    public int updateByPrimaryKey(SSysdict record) {
        int rows = getSqlMapClientTemplate().update("s_sysdict.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    public int updateByPrimaryKeySelective(SSysdict record) {
        int rows = getSqlMapClientTemplate().update("s_sysdict.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    public List selectByExample(SSysdictExample example) {
        List list = getSqlMapClientTemplate().queryForList("s_sysdict.abatorgenerated_selectByExample", example);
        return list;
    }

    public SSysdict selectByPrimaryKey(String recId) {
        SSysdict key = new SSysdict();
        key.setRecId(recId);
        SSysdict record = (SSysdict) getSqlMapClientTemplate().queryForObject("s_sysdict.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    public int deleteByExample(SSysdictExample example) {
        int rows = getSqlMapClientTemplate().delete("s_sysdict.abatorgenerated_deleteByExample", example);
        return rows;
    }

    public int deleteByPrimaryKey(String recId) {
        SSysdict key = new SSysdict();
        key.setRecId(recId);
        int rows = getSqlMapClientTemplate().delete("s_sysdict.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    public int countByExample(SSysdictExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("s_sysdict.abatorgenerated_countByExample", example);
        return count.intValue();
    }

    public int updateByExampleSelective(SSysdict record, SSysdictExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("s_sysdict.abatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExample(SSysdict record, SSysdictExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("s_sysdict.abatorgenerated_updateByExample", parms);
        return rows;
    }

    private static class UpdateByExampleParms extends SSysdictExample {
        private Object record;

        public UpdateByExampleParms(Object record, SSysdictExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}